package com.s20y.register.config;

import com.s20y.register.config.es.EsTasks;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;

@Slf4j
@SpringBootApplication
@EnableScheduling
public class EsApplication implements CommandLineRunner {
    @Autowired
    private EsTasks esTasks;

    public static void main(String[] args) {
        SpringApplication.run(EsApplication.class, args);
    }


    public void run(String... args) {
        log.info(".............................开始启动任务.............................");
        esTasks.reloadIndex();
        log.info(".............................任务启动成功.............................");
    }
}
